package com.design.adapter.player;

// 适配器类，将 ExternalAudioPlayer 适配成 MediaPlayer 接口
class AudioPlayerAdapter implements MediaPlayer {
    private ExternalAudioPlayer externalAudioPlayer;

    public AudioPlayerAdapter(ExternalAudioPlayer externalAudioPlayer) {
        this.externalAudioPlayer = externalAudioPlayer;
    }

    @Override
    public void play(String filename) {
        // 调用 ExternalAudioPlayer 的不兼容方法
        externalAudioPlayer.playAudio(filename);
    }
}
